home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11829 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: newsstand.tc.umn.edu!ianhogg
  2. From: ianhogg@cs.umn.edu (Ian J Hogg)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: HP C++ Compiler Problem w/ templates
  5. Date: 16 Mar 1996 13:22:36 GMT
  6. Organization: University of Minnesota
  7. Message-ID: <4iefas$39i@epx.cis.umn.edu>
  8. References: <4i7i5n$fst@access4.digex.net>
  9. NNTP-Posting-Host: tera.cs.umn.edu
  10.  
  11. In article <4i7i5n$fst@access4.digex.net>,
  12. Mr. Blue <car@access4.digex.net> wrote:
  13. >The HP compiler is generating a file in the ptrepository directory,
  14. >which fails to compile on the link step. It seems that this file is
  15. >missing a #include. If I add the #include manually and CC that file,
  16. >it will compile. If I go back up to the src directory and recompile,
  17. >the file gets regenerated in the ptrepository subdirectory and the
  18. >compile again fails on the link step.
  19. >
  20.  
  21. HP recommends that you put the template class definition in a .h file.  The
  22. definitions of the member functions should go in a .C (or .cc) file.  The
  23. .h should include all headers needed to compile.  It will also include the 
  24. file containing the definition of the class(es) that you are instantiating the
  25. template on.  This header file should also include the headers necessary to
  26. compile the class.
  27.  
  28. --
  29. ===============================================================================
  30. Ian Hogg                        ianhogg@cs.umn.edu
  31.                                                         (612) 424-6332
  32.